home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Know Your Hockey - The Greatest Player Resource
/
Know Your Hockey: The Greatest Player Resource.iso
/
hockey
/
director
/
ssqcst.cst
/
00121_Script_ButtonsObject
< prev
next >
Wrap
Text File
|
1998-09-28
|
4KB
|
129 lines
property LastSelected,NowOn
on new me,which
set NowOn = []
set lastSelected = []
return me
end
--which = sprite channel
-- type-- annimation behavoiur
--1 no mousedown screen state
--2 mousedown screen state
-- 3 special case for pro and jr buttons
-- action -- handler name or go to X
-- clickit = puppetsound that you wantplayed for button click
global gButtonState
on button me, which,type,action,Clickit
put mousecast() into MB
if voidp(Clickit) = 0 then
puppetsound 0
puppetsound Clickit
updatestage
end if
puppetsprite which,1
-- behave according to type required
case type of
1: -- non sticky button does action on mousedown
losepop(window "pop")
repeat while stilldown()=1
if mousecast()= MB then
set the membernum of sprite which to MB+1
set the blend of sprite which = 100
updatestage
next repeat
end if
--return to normal whem off button
if (mousecast() <>MB+1)then
set the membernum of sprite which to MB
set the blend of sprite which = 0
updatestage
end if
updatestage
if rollOver(which) then
do action
end if
end repeat
set the membernum of sprite which to MB
2:
-- threestate button that sticks
set clicked = getat(gbuttonstate,which)
if clicked = 0 then
repeat while stilldown()=1
if mousecast()= MB then
set the membernum of sprite which = MB+1
set the blend of sprite which = 100
updatestage
end if
--return to normal whem off button
if (mousecast() <>MB+1)then
set the member of sprite which to MB
set the blend of sprite which = 0
updatestage
end if
end repeat
else
puppetsound 0
losepop(window "pop")
setat(gbuttonstate,clickon(),0)
set the membernum of sprite which = MB-1
updatestage
exit
end if
if rollOver(which) then
puppetsound 0
set the membernum of sprite which = MB+1-- see note
setat(gbuttonstate,which,2)
updatestage
do action
end if
3:
-- threestate button that sticks
set clicked = getat(gbuttonstate,which)
if clicked = 0 then
repeat while stilldown() = 1
if mousecast()= MB then
set the membernum of sprite which = MB+1
set the blend of sprite which = 100
updatestage
end if
--return to normal whem off button
if (mousecast() <>MB+1)then
set the member of sprite which to MB
set the blend of sprite which = 0
updatestage
end if
updatestage
end repeat
else
setat(gbuttonstate,clickon(),0)
set the membernum of sprite 25= 59
set the membernum of sprite 24= 57
updatestage
do action
exit
end if
if rollOver(which) then
puppetsound 0
set the membernum of sprite which = MB+1-- see note
setat(gbuttonstate,which,2)
updatestage
do action
end if
end case
end
--in bad performance situations the button script did not get executed until
-- the mouse button was up ... as a result the icon would not be updated
-- to avoid this we added a forced update to the icon just before the do command
-- which always excutes including on mouse up